import * as r from '../base_rule';

const meta = new r.QueryMeta({
  name: "TestDslFlowFeature",
  description: `test elegant penmanship of dsl flow feature`,
  severity: 'demo',
  tags: ['test', 'dsl', 'flow'],
})

const query = r.dsl.create(meta, q => q
  .from(f => f
    .withData(v => v.stream().any(s =>
      (s instanceof r.types.InvokeExpr) && s.target === "createMac" &&
      (base => base instanceof r.types.Variable ? base.name === 'cryptoFramework' : false)(s.base)
    )).as("Warning"))
  .select("Warning")
)